<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .regers {
            width: 400px;
            margin: 0 auto;
        }
    </style>
</head>
<body>

<form class="regers">
    <h1 style="text-align: center;">用户注册</h1>
    {% for filed in form %}
        {% if filed.name == 'code' %}
            <div class="form-group">
                <label for="{{ filed.id_for_label }}">{{ filed.label }}</label>
                <div class="clearfix">
                    <div class="col-md-6" style="padding-left: 0;">{{ filed }}</div>
                    <div class="col-md-6" id="yzm" ><input  class="btn btn-default" type="button" value="点击获取验证码"></div>

                </div>
            </div>
        {% else %}
            <div class="form-group">
                <label for="{{ filed.id_for_label }}">{{ filed.label }}</label>
                {{ filed }}
            </div>
        {% endif %}

    {% endfor %}
    <button type="submit" class="btn btn-primary">注 册</button>
</form>



<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
<script>
    $("#yzm").click(function () {
        alert("发送短信")
    })
</script>
</body>
</html>